package com.fxu.mq.producer;

import com.fxu.framework.mq.redis.streams.RedisStreamsHolder;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.connection.stream.RecordId;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * Sms 短信相关消息的 Producer
 *
 * @author fangxu
 * @version 2022-01-07
 */
@Slf4j
@Component
public class RedisStreamsSender {

    /**
     * 发送消息
     * @return 消息信息
     */
    public RecordId sendSmsSendMessage(String streamKey, Map<String, String> message) {
        return RedisStreamsHolder.getHolder().sendMessage(streamKey, message);
    }

}
